<template>
  <div class="sec-top row">
    <form class="form-inline col-sm-12" @submit.prevent="search">
      <div class="form-group form-group-sm">
        <label>姓名:</label>
        <input type="text" class="form-control" v-model="searchInfo.name" placeholder="">
        <label>执业编号:</label>
        <input type="text" class="form-control" v-model="searchInfo.certificateNo" placeholder="">
        <!-- <label>手机号:</label>
        <input type="text" class="form-control" v-model="searchInfo.phone" placeholder="">
        <label>所在机构:</label>
        <input type="text" class="form-control" v-model="searchInfo.orgName" placeholder="">       
        <label>状态:</label>
        <select class="form-control" v-model="searchInfo.status">
          <option value="">请选择</option>
          <option value="0">初始态</option>
          <option value="1">实名认证</option>
          <option value="2">取消资格</option>
        </select>
        <label>报名方式:</label>
        <select class="form-control" v-model="searchInfo.type">
          <option value="">全部</option>
          <option value="1">个人</option>
          <option value="2">团队</option>
        </select> 
        <label>编号和姓名是否匹配:</label>
        <input type="checkbox" class="form-control checkBox" v-model="searchInfo.isNotExist " > -->
        <input type="submit" class="btn btn-sm btn-primary" value="搜索">
      </div>

      <!-- <input @click="exportData" type="button" class="btn btn-sm btn-primary right" value="导出"> -->
      <input @click="importData" type="button" class="btn btn-sm btn-primary right" value="导入">
      <input type="file" class="form-control input-sm right" v-el:settleFile accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
    </form>
  </div>
  <table class="table table-bordered table-hover">
    <caption>投顾报名列表<span class="right">团队成员总数 ：<strong>{{teamMemberCount}} </strong></span></caption>
    <thead>
      <tr>
        <th >姓名</th>
        <th >执业编号</th>
        <th class="col-xs-1">名片</th>
        <th >所在机构(用户输入)</th>
        <th >所在机构</th>
        <th >手机号</th>
        <th class="col-xs-1">用户签名</th>
        <th >电子签名验证状态</th>
        <th >注册状态</th>
        <th >申请状态</th>
        <th >操作</th>
        <th >备注</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in list">
        <td >{{item.name}}<br></td>
        <td :class="{'red': +item.isExist !==1}">
          <template v-if="+item.type !==2">
            <textarea rows="3" cols="15" v-model="item.certificateNo"></textarea>
            <button @click="updateCertificateNo(item)" class="btn btn-sm btn-primary">更新</button>
          </template>
        </td>
        <td><img v-if="item.cardPicUrl" @click="openPicPage(item.cardPicUrl)" :src="item.cardPicUrl"></td>
        <td>{{item.organization}}</td>
        <td>
          <textarea rows="3" cols="15" v-model="item.orgName"></textarea>
          <button @click="updateOrgName(item)" class="btn btn-sm btn-primary">更新</button>
        </td>
        <td>{{item.phone}}</td>
        <td><img v-if="item.signPicUrl" @click="openPicPage(item.signPicUrl)" :src="item.signPicUrl"></td>
        <td>{{+item.signStatus === 1 ? '正常' : '异常'}}</td>
        <td class="text-right col-nowrap">
          <select class="form-control" v-model="item.regStatus">
            <option value='-1'>注册异常</option>
            <option value='0'>已注册</option>
            <option value="1">注册成功</option>
          </select>
          <button @click="updateRegStatus(item)" class="btn btn-sm btn-primary">更新</button>
        </td>
        <td class="text-right col-nowrap">
          <select class="form-control" v-model="item.status">
            <option value='0'>初始态</option>
            <option value="1">实名认证</option>
            <option value="2">取消资格</option>
          </select>
          <button @click="updateStatus(item)" class="btn btn-sm btn-primary">更新</button>
        </td>
        <td class="text-right col-nowrap">
          <button v-if="+item.type ===2" @click="goMembersPage(item.id)" class="btn btn-sm btn-primary">查看成员</button>
          <button @click="deleteItem(item.id)" class="btn btn-sm btn-danger" >删除</button>
        </td>
        <td class="text-right col-nowrap">
          <textarea rows="3" cols="15" v-model="item.remark"></textarea>
          <button @click="updateRemark(item)" class="btn btn-sm btn-primary" >更新</button>
        </td>
        
      </tr>
    </tbody>
  </table>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>
<style src="./personal-list.css" scoped></style>
<script src="./personal-list.js"></script>